package day001;

public class Code05_GetMax {

    public  static int process(int[] arr, int L, int R){
        if(L == R){
            return arr[L];
        }
        int mid = L + ((R - L) >> 1);
         int leftMax = process(arr, L, mid);
        int rightMax = process(arr, mid+1, R);
        return Math.max(leftMax, rightMax);
    }

    public static void main(String[] args) {
        int[] arr = {3,2,5,6,7,4};
        int max = process(arr,0, arr.length-1);
        System.out.println(max);
    }
}
